#ifndef CDN_NVM3_H
#define CDN_NVM3_H
/*
*******************************************************************************
** Copyright (C), 2014-2020, TONLY AV R&D CENTER SOFTWARE DEVELOPMENT DEPARTMENT
** FileName: 
** <author>:             
** Date:
** Description:
**
** Others:
** Function List:
**   1.
** History:
**  <Author>    <date>    <content>    <version>
*******************************************************************************
*/
//*****************************************************************************
// File Include
//*****************************************************************************
#include "stdint.h"
#include <stdio.h>
#include "nvm3_default.h"
#include "nvm3_default_config.h"
#include "nvm3.h"

//*****************************************************************************
// Local Defines
//*****************************************************************************

//存储场景信息
#define SCENE_INFO_KEY_ID1         1
#define SCENE_INFO_KEY_ID2         2
#define SCENE_INFO_KEY_ID3         3
#define SCENE_INFO_KEY_ID4         4
#define SCENE_INFO_KEY_ID5         5
#define SCENE_INFO_KEY_ID6         6
#define SCENE_INFO_KEY_ID7         7
#define SCENE_INFO_KEY_ID8         8
#define SCENE_INFO_KEY_ID9         9
#define SCENE_INFO_KEY_ID10        10
#define SCENE_INFO_KEY_ID11        11
#define SCENE_INFO_KEY_ID12        12
#define SCENE_INFO_KEY_ID13        13
#define SCENE_INFO_KEY_ID14        14
#define SCENE_INFO_KEY_ID15        15
#define SCENE_INFO_KEY_ID16        16
#define SCENE_INFO_KEY_ID17        17
#define SCENE_INFO_KEY_ID18        18
#define SCENE_INFO_KEY_ID19        19
#define SCENE_INFO_KEY_ID20        20
#define SCENE_INFO_KEY_ID21        21
#define SCENE_INFO_KEY_ID22        22
#define SCENE_INFO_KEY_ID23        23
#define SCENE_INFO_KEY_ID24        24
#define SCENE_INFO_KEY_ID25        25
#define SCENE_INFO_KEY_ID26        26
#define SCENE_INFO_KEY_ID27        27
#define SCENE_INFO_KEY_ID28        28
#define SCENE_INFO_KEY_ID29        29
#define SCENE_INFO_KEY_ID30        30
#define SCENE_INFO_KEY_ID31        31
#define SCENE_INFO_KEY_ID32        32
#define SCENE_INFO_KEY_ID33        33
#define SCENE_INFO_KEY_ID34        34
#define SCENE_INFO_KEY_ID35        35
#define SCENE_INFO_KEY_ID36        36
#define SCENE_INFO_KEY_ID37        37
#define SCENE_INFO_KEY_ID38        38
#define SCENE_INFO_KEY_ID39        39
#define SCENE_INFO_KEY_ID40        40
#define SCENE_INFO_KEY_ID41        41
#define SCENE_INFO_KEY_ID42        42
#define SCENE_INFO_KEY_ID43        43
#define SCENE_INFO_KEY_ID44        44
#define SCENE_INFO_KEY_ID45        45
#define SCENE_INFO_KEY_ID46        46
#define SCENE_INFO_KEY_ID47        47
#define SCENE_INFO_KEY_ID48        48
#define SCENE_INFO_KEY_ID49        49
#define SCENE_INFO_KEY_ID50        50
#define SCENE_INFO_KEY_ID51        51
#define SCENE_INFO_KEY_ID52        52
#define SCENE_INFO_KEY_ID53        53
#define SCENE_INFO_KEY_ID54        54
#define SCENE_INFO_KEY_ID55        55
#define SCENE_INFO_KEY_ID56        56
#define SCENE_INFO_KEY_ID57        57
#define SCENE_INFO_KEY_ID58        58

//存储组地址等信息
#define LIGHT_INFO_KEY_ID59        59	

//功率档位
#define POWER_MODE_KEY_ID60        60

//断电记忆场景
#define SCENE_MEMORY_KEY_ID61      61

//断电上电开关复位
#define POWER_SWITCH_RESET_ID62    62

//最大存储ID数
#define FLASH_KEY_ID_MAX      62

void cdn_nvm3_init(void);
void cdn_nvm3_write(uint8_t key,uint8_t *data,size_t len);
void cdn_nvm3_read(uint8_t key,char *buffer);
void cdn_nvm3_delete(uint8_t key);
void cdn_nvm3_erase_custom_flash(void);
void cdn_nvm3_process_action(void);
Ecode_t CdnNvm3repack(void);

#endif
